<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sp" uri="http://www.springframework.org/tags"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>My JSP 'add.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3" />
<meta http-equiv="description" content="This is my page" />
<link href="/css/reset.css" rel="stylesheet" type="text/css" />
<link href="/css/common.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="/js/jquery_datapicker/themes/min/jquery.ui.all.min.css" />
<link rel="stylesheet" href="/js/jquery_datapicker/themes/min/jquery.ui.datepicker.min.css" />
<script type="text/javascript" src="/js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="/js/jquery_datapicker/ui/jquery.ui.core.min.js"></script>
<script type="text/javascript" src="/js/jquery_datapicker/ui/jquery.ui.widget.min.js"></script>
<script type="text/javascript" src="/js/jquery_datapicker/ui/jquery.ui.datepicker.min.js"></script>
<script type="text/javascript" src="/js/jquery_datapicker/ui/i18n/jquery.ui.datepicker-zh-CN.min.js"></script>
<script type="text/javascript" charset="utf-8" src="/js/formcheck/formcheck-0.0.1.js"></script>
<style type="text/css">
#tr_upload td {
	display: none;
	visibility: hidden;
}
</style>
</head>

<body class="mainframe">
	<form action="/admin/article/add.dhtml" method="post">
		<input type="hidden" name="article.catalogId" value="<c:out value="${article.catalogId}" />" />
		<table class="admin_table">
			<caption>添加新闻</caption>
			<c:choose>
				<c:when test="${message.info != null }">
					<tr>
						<td colspan="2"><sp:message code="${message.info}" text="" /></td>
					</tr>
				</c:when>
				<c:otherwise>
					<tr>
						<td>标题</td>
						<td><input type="text" id="articleTitle" name="article.title" /><span id="articleTitleTip"></span></td>
					</tr>
					<tr>
						<td>作者</td>
						<td><input type="text" id="articleAuthor" name="article.author" /></td>
					</tr>
					<tr>
						<td>摘要</td>
						<td><textarea id="articleSummary" name="article.summary" rows="4" cols="100"></textarea></td>
					</tr>
					<tr>
						<td>关键字</td>
						<td><input type="text" id="articleKeywords" name="article.keywords" /></td>
					</tr>
					<tr>
						<td>推荐</td>
						<td><select name="article.sort">
								<option value="0">默认</option>
								<option value="1">推荐</option>
						</select></td>
					</tr>
					<tr>
						<td>正文</td>
						<td><textarea id="articleContent" name="article.content" rows="4" cols="100"></textarea></td>
					</tr>
					<tr>
						<td></td>
						<td><input type="submit" id="articleSubmit" value="添加" class="button01" /></td>
					</tr>
				</c:otherwise>
			</c:choose>
		</table>
	</form>
	<script type="text/javascript" src="/js/ckeditor/ckeditor.js"></script>
	<script type="text/javascript">
		CKEDITOR.replace("articleContent");
		
		// 表单验证
		var formCheck = $.formCheck();
		formCheck.regAllEmpty("articleTitle", {
			onShow : "输入目录名称",
			onFocus : "此项为必填",
			onError : "此项为必填",
			onCorrect : "目录名称输入正确"
		}, true);
		formCheck.formCheck("articleCateForm");
	</script>
</body>
</html>